<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	  xmlns:fs="http://www.wueasy.com">
<head>
	<head th:include="layout :: header" th:remove="tag"/>
	<div th:include="layout :: frame" th:remove="tag"/>
</head>
<body>

<div class="layui-fluid">  
<div class="layui-card">
<div class="layui-card-body">
<form class="layui-form" isLoad="1" loadFuncNo="T1023" id="form">
  <input type="hidden" name="id" autocomplete="off" class="layui-input"/>
  <input type="hidden" name="catalogId" autocomplete="off" class="layui-input"/>
  <div class="layui-form-item">
    <label class="layui-form-label"><i class="required">*</i>模板名称：</label>
    <div class="layui-input-block">
      <input type="text" name="name" required="" lay-verType="tips" lay-verify="required" placeholder="请输入模板名称" autocomplete="off" class="layui-input"/>
    </div>
  </div>
  <div class="layui-form-item layui-form-text">
    <label class="layui-form-label"><i class="required">*</i>模板类型：</label>
    <div class="layui-input-block">
      <select name="type" id="templatetype" class="fsDict" lay-filter="type" dict="templatetype"></select>
    </div>
  </div>
  <div class="layui-form-item layui-form-text">
    <label class="layui-form-label"><i class="required">*</i>编码：</label>
    <div class="layui-input-inline">
      <select name="encoding" class="fsDict" dict="encoding"></select>
    </div>
    <label class="layui-form-label"><i class="required">*</i>状态：</label>
    <div class="layui-input-inline">
      <input type="checkbox" name="state" lay-skin="switch" lay-text="有效|无效" checked="checked" value="1"/>
    </div>
  </div>
  <div class="layui-form-item" style="display: none;" id="filePathDiv">
    <label class="layui-form-label">发布路径</label>
    <div class="layui-input-block">
      <input type="text" name="filePath" autocomplete="off" class="layui-input"/>
    </div>
  </div>
  <div class="layui-form-item layui-form-text">
    <label class="layui-form-label"><i class="required">*</i>模板内容：</label>
    <div class="layui-input-block">
      <textarea name="content" placeholder="请输入模板内容" lay-verType="tips" class="layui-textarea"></textarea>
    </div>
  </div>
  <hr/>
  <div class="layui-form-item">
    <div class="layui-input-block">
      <button class="layui-btn" lay-submit="" lay-filter="submit" funcNo="T1022"><i class="layui-icon layui-icon-edit"></i>编辑</button>
      <button type="button" class="layui-btn layui-btn-primary" function="close">关闭</button>
    </div>
  </div>
</form>
</div>
</div>
</div>
<script type="text/javascript">
layui.fsCallback.form.form = function(thisForm){
	layui.form.on('select(type)', function(data){
	  if(data.value == "4"){
	  	$("#filePathDiv").show();
	  }else{
	  	$("#filePathDiv").hide();
	  }
	});
	
	if($("#templatetype").val() == "4"){
		$("#filePathDiv").show();
	}
}
</script>
</body>
</html>